var a = {name: "myname"};

if(a.hasOwnProperty("name")) {
    console.log('correct');
} else {
    console.log('wrong');
}
